<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link  rel="stylesheet" type="text/css" href="css/test.css">
    <link  rel="stylesheet" type="text/css" href="css/base.css">
    <link  rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <script src="js/hotime-v2.js" type="text/javascript"></script>
    <script src="js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="js/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" href="css/bootstrap-datetimepicker.css">


    <title>足彩智能分析平台</title>
    <style>
        .cont{
            padding:30px;}
        .opa{
            padding:0 5px; cursor: pointer;
        }
        .opa:hover{color: #d9534f}
    </style>
</head>
<body>
<div class="container-fluid cont">
    <div class="form-inline form-group">
        <!--<select class="form-control">-->
            <!--<option>今天</option>-->
            <!--<option>2016-10-10</option>-->
            <!--<option>2016-10-09</option>-->
            <!--<option>2016-10-08</option>-->
            <!--<option>2016-10-07</option>-->
            <!--<option>2016-10-06</option>-->
            <!--<option>2016-10-05</option>-->
        <!--</select>-->

        选择时间：<input type="text"  id="datetimepicker" style="width: 150px" class="input  form-control"/>

    </div>
    <div>
        <!--<select class="data-select">-->
            <!--<option value="0">live.500.com</option>-->
            <!--<option value="1">win007.com</option>-->
        <!--</select>-->
        <!--<form>-->
            <!--&lt;!&ndash;<input type="radio" name="data-select" checked class="data-select" value="0">&ndash;&gt;-->
            <!--&lt;!&ndash;live.500.com&ndash;&gt;-->
            <!--&lt;!&ndash;<br>&ndash;&gt;-->
            <!--&lt;!&ndash;<input type="radio" name="data-select" class="data-select" value="1">win007.com&ndash;&gt;-->
        <!--</form>-->
        live.500.com
        <br>
        <button type="button" class="data-select">切换至win007.com</button>
    </div>

<table class="table table-content table-bordered table-striped table-hover">
<thead>
<tr>
    <td>场次</td>
    <td>赛事</td>
    <td>轮次</td>
    <td>比赛时间</td>
    <td>状态</td>
    <td>主队</td>
    <td>比分</td>
    <td>客队</td>
    <td>半场</td>
    <td>胜负</td>
    <td>指数</td>
    <td>bet365</td>
    <td>指数</td>
    <td>直播</td>
    <td>分析</td>
</tr>
</thead>
    <tbody>
    <tr h="tr">
        <td>{bnumber}</td>
        <td class="bgame">{bgame}</td>
        <td class="blunci">{blunci}</td>
        <td class="btime">{btime}</td>
        <td>{bstate}</td>

        <td class="bmasterteam">{bmasterteam}</td>
        <td >{bpoints}</td>
        <td class="bslaveteam">{bslaveteam}</td>
        <td>{bhalf}</td>
        <td>{bmoney}</td>
        <td>{zhishul}</td>
        <td>{bet365}</td>
        <td>{zhishur}</td>
        <td><a target="_blank"  href="{bvideo}">直播</a></td>
        <td><a target="_blank" href="{bfenxi}" class="opa">析</a>
            <a  class="ya opa" data-href="info.html?fid={fid}&quancheng={bgame}&type={type}&win={win}" fid=>亚</a>
            <a href="{bou}" target="_blank" class="opa">欧</a></td>
    </tr>
    </tbody>

</table>
</div>
<script>
    var Ball={
        create:function () {
            this.data({type:0});
            this.init();
        },
        data:function (date) {

            H.post("app/ball/get",date,function (res) {
                if(res.statu!=0){
                    alert(res.result.msg)
                    return
                }

                $(".table-content tbody").html(H.tpt.output('tr',res.result,function (res) {

                    res.win=res.bmoney;

                    if(res.bmoney==1){
                        res.bmoney="胜"
                    }else
                    if(res.bmoney==0){
                        res.bmoney="平"
                    }else
                    if(res.bmoney==2){
                        res.bmoney="负"
                    }else
                    if(res.bmoney==3){
                        res.bmoney="未完"
                    }


                }));
                $(".ya").click(function () {
                    window.open($(this).data('href')+"&bmasterteam="+$(this).parents("tr").find(".bmasterteam").text()+
                            "&bslaveteam="+$(this).parents("tr").find(".bslaveteam").text()+"&bgame="+$(this).parents("tr").find(".bgame").text()+
                    "&blunci="+$(this).parents("tr").find(".blunci").text()+"&btime="+$(this).parents("tr").find(".btime").text() );
                })


            })
        },
        init:function () {

            $('#datetimepicker').datetimepicker({
                minView: "month", //选择日期后，不会再跳转去选择时分秒
                format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式
                language: 'zh-CN', //汉化
                todayBtn: true,
                autoclose:true //选择日期后自动关闭
            });


            $("#datetimepicker").change(function () {
                if($(this).val()!="今天"){
                    Ball.data({date:$(this).val(),type:0})

                }else{
                    Ball.data()
                }
            })
            $(".data-select").click(function () {
                window.open("index-win.html");
//                if($(this).val()!="今天"){
//                if($("#datetimepicker").val()==""){
//                    Ball.data({type:0})
//                }else{
//                    Ball.data({date:$("#datetimepicker").val(),type:0})
//                }

//                }else{
//                    Ball.data()
//                }
            })

        }
    }
    Ball.create()

</script>
</body>
</html>